﻿using FluentNHibernate.Mapping;
using SimpleScrum.Core.Entities;

namespace SimpleScrum.Core.Mappings
{
    public class UserStoryTaskMap : ClassMap<UserStoryTask>
    {
        public UserStoryTaskMap()
        {
            Table("UserStoryTask");
            LazyLoad();
            Id(x => x.Id).Column("ID").GeneratedBy.GuidComb();
            Map(x => x.Name).Column("Name").Not.Nullable();
            Map(x => x.WorkHour).Column("WorkHour").Not.Nullable();
            Map(x => x.AssignDate).Column("AssignDate").Not.Nullable();
            References(x => x.AssignTo).Column("AssignTo").Cascade.All();
            References(x => x.UserStory).Column("UserStoryId").Cascade.All();
        }
    }
}